import { $Http } from '@/config/service/http';

export enum Api {
  listByOrgId = '/system/subject/listByOrgId', // 根据部门id查询用户列表[SYSTEM-SUBJECT-003]

  // 部门文件目录
  deptBatchDelete = '/dmsfile/deptFileDirectory/batchDelete', // 批量删除
  // deptBatchDownload = '/dmsfile/deptFileDirectory/createBatchDownloadTask', // 批量下载
  deptBatchDownload = '/dmsfile/deptFileDirectory/batchDownload', // 批量下载
  deptCopyFile = '/dmsfile/deptFileDirectory/copyFile', // 复制文件
  deptCreateDeptFolder = '/dmsfile/deptFileDirectory/createDeptFolder', // 创建部门文件夹
  deptDelete = '/dmsfile/deptFileDirectory/delete', // 删除
  deptDownload = '/dmsfile/deptFileDirectory/download', // 单个下载
  // deptDownload = '/dmsfile/deptFileInfo/downloadPartFile', // 单个下载
  deptGet = '/dmsfile/deptFileDirectory/get', // 详情
  deptGetChildrenFolders = '/dmsfile/deptFileDirectory/getChildrenFolders', // 获取子文件夹列表
  deptGetParentFolder = '/dmsfile/deptFileDirectory/getParentFolder', // 得到指定父层级的文件夹
  deptMoveFile = '/dmsfile/deptFileDirectory/moveFile', // 移动文件
  deptPage = '/dmsfile/deptFileDirectory/page', // 分页查询
  deptQueryFolderWithFilePage = '/dmsfile/deptFileDirectory/queryFolderWithFilePage', // 文件夹和文件分页查询
  deptQueryParentFolderFilePage = '/dmsfile/deptFileDirectory/queryParentFolderFilePage', // 得到父亲文件夹下的目录和文件列表分页查询
  deptRename = '/dmsfile/deptFileDirectory/rename', // 重命名
  deptSave = '/dmsfile/deptFileDirectory/save', // 保存
  deptUpdateStatus = '/dmsfile/deptFileDirectory/updateStatus', // 更新状态
  // 部门文件详情
  fileCopy = '/dmsfile/deptFileInfo/copyFile', // 复制文件
  fileDelete = '/dmsfile/deptFileInfo/delete', // 删除
  fileDownload = '/dmsfile/deptFileInfo/downloadFile/{id}', // 下载文件
  fileDownloadBytes = '/dmsfile/deptFileInfo/downloadFileByBytes/{id}', // 下载文件字节方式
  fileGet = '/dmsfile/deptFileInfo/get', // 详情
  fileGetChildren = '/dmsfile/deptFileInfo/getChildrenFiles', // 得到文件夹下的目录列表下的文件
  fileGetOnlineEditConfig = '/dmsfile/deptFileInfo/getOnlineEditConfig', // 得到在线编辑的配置信息
  fileGetPreviewFileUrl = '/dmsfile/deptFileInfo/getPreviewFileUrl', // 获取文件预览地址
  fileGetPublicVisitFileUrl = '/dmsfile/deptFileInfo/getPublicVisitFileUrl', // 获取文件公共访问地址
  fileList = '/dmsfile/deptFileInfo/list', // 根据ids获取文件详情
  fileMove = '/dmsfile/deptFileInfo/moveFile', // 移动文件
  filePage = '/dmsfile/deptFileInfo/page', // 分页查询
  fileRename = '/dmsfile/deptFileInfo/rename', // 重命名
  fileSave = '/dmsfile/deptFileInfo/save', // 保存
  fileUpload = '/dmsfile/deptFileInfo/uploadFile', // 上传文件
  fileUploadFileByBase64 = '/dmsfile/deptFileInfo/uploadFileByBase64', // 通过Base64字节上传文件
  fileUploadFileByBytes = '/dmsfile/deptFileInfo/uploadFileByBytes', // 通过字节上传文件
  fileUploadFiles = '/dmsfile/deptFileInfo/uploadFiles', // 上传多个文件
  fileView = '/dmsfile/deptFileInfo/viewFile', // 查看文件
  fileOptlist = '/dmsfile/deptFileDirectory/getFileOptList', // 获取文件权限
  // 部门文件版本
  versionDelete = '/dmsfile/deptFileVersion/delete', // 删除
  versionDownload = '/dmsfile/deptFileVersion/download', // 查看文件
  versionGet = '/dmsfile/deptFileVersion/get', // 详情
  versionGetByFileId = '/dmsfile/deptFileVersion/getByFileId', // 得到文件版本列表
  versionGetPreviewFileUrl = '/dmsfile/deptFileVersion/getPreviewFileUrl', // 获取文件预览地址
  versionGetPublicVisitFileUrl = '/dmsfile/deptFileVersion/getPublicVisitFileUrl', // 获取文件公共访问地址
  versionPage = '/dmsfile/deptFileVersion/page', // 分页查询
  versionSave = '/dmsfile/deptFileVersion/save', // 保存
  versionSetAsCurrent = '/dmsfile/deptFileVersion/setAsCurrent', // 设置当前版本为最新版本
  versionViewFile = '/dmsfile/deptFileVersion/viewFile', // 查看文件
  // 部门文件任务记录
  recordDelete = '/dmsfile/deptFileTaskRecord/delete', // 删除
  recordGet = '/dmsfile/deptFileTaskRecord/get', // 详情
  recordPage = '/dmsfile/deptFileTaskRecord/page', // 分页查询
  recordSave = '/dmsfile/deptFileTaskRecord/save', // 保存

  // 部门文件权限设置
  savePermission = 'dmsfile/deptFilePermission/savePermissionList', // 保存权限设置
  getPermission = '/dmsfile/deptFilePermission/getPermissionUserList' // 获取权限设置列表(用户列表视角)
}

export const listByOrgId = (params) => {
  return $Http.api(Api.listByOrgId, params, 'post-form');
};

export const deptBatchDelete = (params) => {
  return $Http.api(Api.deptBatchDelete, params, 'post');
};

export const deptCreateDeptFolder = (params) => {
  return $Http.api(Api.deptCreateDeptFolder, params, 'post');
};

export const deptGet = (id) => {
  return $Http.api(Api.deptGet, id, 'get');
};

export const deptGetChildrenFolders = (params) => {
  return $Http.api(Api.deptGetChildrenFolders, params, 'post');
};

export const deptSave = (params) => {
  return $Http.api(Api.deptSave, params, 'post');
};

export const fileGetPreviewFileUrl = (params) => {
  return $Http.api(Api.fileGetPreviewFileUrl, params, 'post');
};

export const deptUpdateStatus = (params) => {
  return $Http.api(Api.deptUpdateStatus, params, 'post');
};

export const savePermission = (id, params) => {
  return $Http.api(Api.savePermission + '/' + id, params, 'post');
};

export const getPermission = (params) => {
  return $Http.api(Api.getPermission, params, 'get');
};

export const setAsCurrent = (params) => {
  return $Http.api(Api.versionSetAsCurrent, params, 'post');
};

export const fileOptlist = (params) => {
  return $Http.api(Api.fileOptlist, params, 'post');
};
